# pylint: disable-msg=C0301
'''
 
@author: christian 
apt-get install html5lib
apt-get install python-beautifulsoup
apt-get install python-lxml 
apt-get install python-pyquery 

http://yuji.wordpress.com/2008/05/14/python-basics-of-python-dictionary-and-looping-through-them/
http://stackoverflow.com/questions/493819/python-join-why-is-it-string-joinlist-instead-of-list-joinstring
'''

from utils import utils

def main():
    '''
    para que pylint no muestre tantos mensajes =)
    http://stackoverflow.com/questions/709490/python-code-convention-using-pylint
    '''
    url = "www.google.com"
    html = utils.HtmlExtractor(url)
    #aseguramos que url siempre comienze por http:// o https://
    url = html.get_url()
    #print html.get_body()
    data_extractor = utils.DataExtractor(html.get_body(), url, only_href = True)
    urls = data_extractor.get_urls()
    print "URLS: "
    for temp in urls:
        print temp
    domains = data_extractor.get_domains(urls)
    print "Dominios: "
    for temp in domains:
        print temp
    ips = data_extractor.get_ips_for_domains(domains)
    for key in ips.iterkeys():
        print key, ": ", " ".join(ips[key])

if __name__ == "__main__":
    main()
